package com.lepu.app.fun.my;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.text.InputFilter;
import android.widget.EditText;

import com.core.lib.application.BaseFragmentActivity;
import com.core.lib.utils.EmojiFilter;
import com.eyzhs.app.R;
import com.lepu.app.widget.CustomTopBarNew;
import com.lepu.app.widget.CustomTopBarNew.OnTopbarNewLeftLayoutListener;

/**
 * 个人信息页面，添加好友
 */
public class ReportContentActivity extends BaseFragmentActivity implements
        OnTopbarNewLeftLayoutListener, CustomTopBarNew.OnTopbarNewRightButtonListener {
    private EditText editText;
    private String mToJID;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.reportconent_activity);
        init();
    }

    @Override
    public void onDestroy() {
        super.onDestroy();
    }

    /**
     * 添加页面动画，需要重写这个方法，
     */
    @Override
    public void onBackPressed() {
        finish(true);
    }

    @Override
    public void onTopbarLeftLayoutSelected() {
        finish(true);
    }
    //===================================================================

    /**
     * 初始化方法
     */
    private void init() {
        // mToJID = getIntent().getStringExtra(Const.TOJID);
        CustomTopBarNew topbar = (CustomTopBarNew) findViewById(R.id.topbar);
        topbar.setTopbarTitle(R.string.buchong);
        topbar.setRightText(R.string.save);
        topbar.setonTopbarNewLeftLayoutListener(this);
        topbar.setOnTopbarNewRightButtonListener(this);
        editText = (EditText) findViewById(R.id.edit_submit_request);
        editText.setFilters(new InputFilter[]{
                new EmojiFilter()
        });
    }

    @Override
    public void onTopbarRightButtonSelected() {
        String requestValue = editText.getText().toString();
        Intent intent = new Intent();
        intent.putExtra("content", requestValue);
        setResult(Activity.RESULT_OK, intent);
        finish(true);
    }
}